﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tp.Interfaces.Datalayer;

namespace Tp.Services.Manager
{
	  public class DataManager
	  {
			public static IDataLayer CreateDataLayer(Type type)
			{
				  IDataLayer datalayer = (Activator.CreateInstance(type) as IDataLayer);
				  if (datalayer != null)
				  {
                        string conString;
                        conString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\Work\Projects\tp-office\Tp.Models\TpOffice.mdf;Integrated Security=True;Connect Timeout=30";
                        //conString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\Work\tp-office\Tp.Models\TpOffice.mdf;Integrated Security=True;Connect Timeout=30";
						//conString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\Work\Projects\tp-office\Tp.Models\TpOffice.mdf;Integrated Security=True;Connect Timeout=30";
                        //conString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=H:\Sw\To\test\to\tp-office\Tp.Models\TpOffice.mdf;Integrated Security=True;Connect Timeout=30";
                      datalayer.Initialize(conString);
				  }
				  return datalayer;
			}
	  }
}
